package bitmap;

import java.io.*;
import java.lang.*;
import global.*;
import diskmgr.*;
import btree.*;
import bufmgr.*;
import heap.*;

public class BM implements GlobalConst{
	
	public static void printBitMap(BitMapHeaderPage header) 
    throws IOException, 
	   ConstructPageException, 
	   IteratorException,
	   HashEntryNotFoundException,
	   InvalidFrameNumberException,
	   PageUnpinnedException,
	   ReplacerException 
    {
      if(header.empty()) {
	System.out.println("Bit Map Index is Empty!!!");
	return;
      }
      
      System.out.println("");
      System.out.println("");
      System.out.println("");
      System.out.println("---------------Bit Map Index---------------");
      System.out.println("\n");
      
      PageId newPage;
      newPage = header.getCurPage();
      while(newPage.pid == INVALID_PAGE)
      {
    	  System.out.println(header.getBMpageArray());
    	  System.out.println("\n");
    	  newPage = header.getNextPage();
      }
    }
}
